﻿<%@ Page Language="C#" MasterPageFile="~/pages/master/WebForm.Master" AutoEventWireup="true"
    CodeBehind="HospitalEdit.aspx.cs" Inherits="BF.Web.pages.Dictionary.HospitalManagement.HospitalEdit" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Src="~/pages/UserControls/SysAreaTree.ascx" TagName="areaControl" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(function () {
            //            $("#ctl00_ContentPlaceHolder1_ddlfatherNodeName").attr("readonly", "readonly");
        });

        function DoClose() {
            winer.close();
        }

        function Save() {
            CheckInput();
            if (CheckInput()) {
                ChangeDiv();
            }
            return CheckInput();
        }

        function Update(values) {
            $(parent.document).find(".x-window-header-text").html("医疗机构修改");
            window.location.href = 'HospitalEdit.aspx?gKey=' + values + '&sfatherNodeName=' + encodeURIComponent($("#ctl00_ContentPlaceHolder1_hidFatherName").val()) + '&sfathergkey=' + $("#ctl00_ContentPlaceHolder1_hidFathergKey").val();
        }

        function DoAdd() {
            $(parent.document).find(".x-window-header-text").html("医疗机构新增");
            this.location.href = 'HospitalEdit.aspx?sfatherNodeName=' + encodeURIComponent($("#ctl00_ContentPlaceHolder1_hidFatherName").val()) + '&sfathergkey=' + $("#ctl00_ContentPlaceHolder1_hidFathergKey").val();
            return false;
        }

        function CheckInput() {
            var result = $("#aspnetForm").validate({
                rules: {
                    ctl00$ContentPlaceHolder1$txtOrganizationCode: {//机构代码
                        required: true,
                        maxlength: 30
                    },
                    ctl00$ContentPlaceHolder1$txtOrganizationName: {//机构名称
                        required: true,
                        maxlength: 25
                    },
                    ctl00$ContentPlaceHolder1$ddlOrganizationType: {//机构类型
                        ddlRequired: true
                    },
                    ctl00$ContentPlaceHolder1$ddlOrganizationLevel: {//机构级别
                        ddlRequired: true
                    },
                    ctl00$ContentPlaceHolder1$txtXNHCode: {//新农合网点编号
                        maxlength: 20
                    },
                    ctl00$ContentPlaceHolder1$txtYBCode: {//医保网点编号
                        maxlength: 20
                    },
                    ctl00$ContentPlaceHolder1$txtgCertificateNo: {//执业许可证号
                        maxlength: 50
                    },
                    ctl00$ContentPlaceHolder1$txtTelephone: {//联系电话
                        isPhone: true,
                        maxlength: 30
                    },
                    ctl00$ContentPlaceHolder1$txtFax: {//传真
                        phone: true,
                        maxlength: 30
                    },
                    ctl00$ContentPlaceHolder1$txtMail: {//电子邮箱
                        email: true,
                        maxlength: 30
                    },
                    ctl00$ContentPlaceHolder1$txtZipCode: {//邮政编码
                        zip: true,
                        maxlength: 10
                    },
                    ctl00$ContentPlaceHolder1$txtAddress: {//通讯地址
                        maxlength: 25
                    },
                    ctl00$ContentPlaceHolder1$txtLegal: {//法人代表
                        maxlength: 10
                    },
                    ctl00$ContentPlaceHolder1$txtCharge: {//机构负责人
                        maxlength: 10
                    },
                    ctl00$ContentPlaceHolder1$txtRegister: {//注册资金
                        number: true,
                        IsTwoPoint: true
                    },
                    ctl00$ContentPlaceHolder1$ddbRegister: {//注册时间
                        dateISO: true
                    },
                    ctl00$ContentPlaceHolder1$txtArea: {//占地面积
                        number: true,
                        IsTwoPoint: true
                    },
                    ctl00$ContentPlaceHolder1$txtConstructionArea: {//建筑面积
                        number: true,
                        IsTwoPoint: true
                    },
                    ctl00$ContentPlaceHolder1$txtPeopNum: {//人员总数
                        digits: true,
                        maxlength: 10
                    },
                    ctl00$ContentPlaceHolder1$txtMedicalNurse: {//医护人数
                        digits: true,
                        maxlength: 10
                    },
                    ctl00$ContentPlaceHolder1$txtSections: {//诊疗科室数
                        digits: true,
                        maxlength: 10
                    },
                    ctl00$ContentPlaceHolder1$txtWard: {//病区数
                        digits: true,
                        maxlength: 10
                    },
                    ctl00$ContentPlaceHolder1$txtBeds: {//病床数
                        digits: true,
                        maxlength: 10
                    }
                },
                errorClass: "errorClass"
            });
            return result.form();
        }

        //        jQuery.validator.addMethod("ararrequired", function (value, element) {
        //            return value != -1;
        //        }, "*地区必选");


    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:HiddenField ID="hidFatherName" runat="server" />
    <asp:HiddenField ID="hidFathergKey" runat="server" />
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="content01">
        <tbody>
            <tr style="height: 18px;">
                <td colspan="4">
                </td>
            </tr>
            <tr>
                <td align="right">
                    上级机构名称：
                </td>
                <td colspan="3">
                    <tll:DataTextBox ID="ddlfatherNodeName" runat="server"></tll:DataTextBox>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <span style="color: Red">*</span>组织机构代码：
                </td>
                <td>
                    <tll:DataTextBox ID="txtOrganizationCode" runat="server" FeildName="sOrganizationCode"
                        TableName="dic_Organization"></tll:DataTextBox>
                </td>
                <td align="right">
                    <span style="color: Red">*</span>机构名称：
                </td>
                <td>
                    <tll:DataTextBox ID="txtOrganizationName" runat="server" FeildName="sOrganizationName"
                        TableName="dic_Organization"></tll:DataTextBox>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <span style="color: Red">*</span>机构类型：
                </td>
                <td>
                    <tll:DataDropDownList ID="ddlOrganizationType" runat="server" FeildName="sOrganizationType"
                        TableName="dic_Organization">
                    </tll:DataDropDownList>
                </td>
                <td align="right">
                    <span style="color: Red">*</span>机构级别：
                </td>
                <td>
                    <tll:DataDropDownList ID="ddlOrganizationLevel" runat="server" FeildName="sOrganizationLevel"
                        TableName="dic_Organization">
                    </tll:DataDropDownList>
                </td>
            </tr>
            <tr>
                <td align="right">
                    联系电话：
                </td>
                <td>
                    <tll:DataTextBox ID="txtTelephone" runat="server" FeildName="sTelephone" TableName="dic_Organization"></tll:DataTextBox>
                </td>
                <td align="right">
                    传真：
                </td>
                <td>
                    <tll:DataTextBox ID="txtFax" runat="server" FeildName="sFax" TableName="dic_Organization"></tll:DataTextBox>
                </td>
            </tr>
            <tr>
                <td align="right">
                    电子邮箱：
                </td>
                <td>
                    <tll:DataTextBox ID="txtMail" runat="server" FeildName="sMail" TableName="dic_Organization"></tll:DataTextBox>
                </td>
                <td align="right">
                    邮政编码：
                </td>
                <td>
                    <tll:DataTextBox ID="txtZipCode" runat="server" FeildName="sZipCode" TableName="dic_Organization"></tll:DataTextBox>
                </td>
            </tr>
            <tr>
                <td align="right">
                    法人代表：
                </td>
                <td>
                    <tll:DataTextBox ID="txtLegal" runat="server" FeildName="sLegal" TableName="dic_Organization"></tll:DataTextBox>
                </td>
                <td align="right">
                    机构负责人：
                </td>
                <td>
                    <tll:DataTextBox ID="txtCharge" runat="server" FeildName="sCharge" TableName="dic_Organization"></tll:DataTextBox>
                </td>
            </tr>
            <tr>
                <td align="right">
                    通讯地址：
                </td>
                <td colspan="3">
                    <tll:DataTextBox ID="txtAddress" runat="server" FeildName="sAddress" TableName="dic_Organization"
                        Width="555"></tll:DataTextBox>
                </td>
            </tr>
            
        </tbody>
    </table>
    <table width="100%" height="36" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr style="height: 18px;">
            <td colspan="4">
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:Button ID="lbtnAdd" runat="server" TabIndex="0" Text="新增" class="btn04" OnClientClick="return DoAdd();" />&nbsp;
                <asp:Button ID="lbtnSave" runat="server" OnClick="lbtnSave_Click" OnClientClick="return Save();"
                    TabIndex="0" Text="保存" class="btn04" />&nbsp;
                <asp:Button ID="btnClose" runat="server" OnClientClick="return DoClose() ;" TabIndex="0"
                    Text="关闭" class="btn04" />
            </td>
        </tr>
    </table>
    <asp:UpdatePanel ID="Updatepanel1" runat="server">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="lbtnSave" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
